home *** CD-ROM | disk | FTP | other *** search
- on dostartMovie
- global gNumPlayers, gPathToSound, fileDelimiter, gMusicChannel, gVoiceChannel, gSoundFXChannel, gAnimObj, gCurrQuestion, gQAnimFirst, gQAnimLength, gTenQList, gTextFileID, gTextData, gValueSprite, gCatSprite, gKeyList, gScoreList, gName1Sprite, gName2Sprite, gName3Sprite, gScore1Sprite, gScore2Sprite, gScore3Sprite, gPlayerCounter, gNullCast, gNumOfQuestions, gNumOfTotalQuestions, gStaticAllQuestList, gDynamicAllQuestList
- clearGlobals()
- unloadMember()
- KillEmPuppets()
- set gNumOfQuestions to 10
- set gNumOfTotalQuestions to 94
- set gNullCast to the number of member "Null Cast"
- set gName1Sprite to 28
- set gName2Sprite to 29
- set gName3Sprite to 30
- set gScore1Sprite to 31
- set gScore2Sprite to 32
- set gScore3Sprite to 33
- set gValueSprite to 10
- set gCatSprite to 11
- set gNumPlayers to 0
- set gPlayerCounter to 0
- set gScoreList to [0, 0, 0]
- set gCurrQueston to 0
- set gKeyList to ["a", "b", "l"]
- set the castLibNum of sprite gCatSprite to the number of castLib "categories and point values"
- set the castLibNum of sprite gValueSprite to the number of castLib "categories and point values"
- set gStaticAllQuestList to []
- repeat while count(gStaticAllQuestList) < gNumOfTotalQuestions
- set jRandom to random(gNumOfTotalQuestions)
- if not getPos(gStaticAllQuestList, jRandom) then
- add(gStaticAllQuestList, jRandom)
- end if
- end repeat
- set gDynamicAllQuestList to duplicate(gStaticAllQuestList)
- set gQAnimFirst to []
- repeat with i = 1 to gNumOfQuestions
- add(gQAnimFirst, the number of member ("Quest" & i) of castLib "Question Titles")
- end repeat
- set gQAnimLength to [31, 31, 44, 30, 31, 50, 38, 31, 31, 36]
- set gCurrQuestion to 0
- case item 1 of the platform of
- "Windows":
- set fileDelimiter to "\"
- set jFileName to "pcquest.txt"
- "Macintosh":
- set fileDelimiter to ":"
- set jFileName to "macquest.txt"
- end case
- set gPathToSound to the pathName & "Audio" & fileDelimiter
- set gMusicChannel to 2
- set gVoiceChannel to 1
- set gSoundFXChannel to 3
- sound stop gMusicChannel
- sound stop gVoiceChannel
- sound stop gSoundFXChannel
- set the volume of sound gMusicChannel to 255
- set the volume of sound gVoiceChannel to 255
- set the volume of sound gSoundFXChannel to 255
- set the actorList to []
- set gAnimObj to new(script "Anim Object Script", 35)
- if item 1 of the platform = "Windows" then
- openXLib("fileio.dll")
- end if
- set gTextFileID to FileIO(mnew, "read", the pathName & jFileName)
- set gTextData to gTextFileID(mReadFile)
- end
-
- on stopMovie
- global gTextFileID, gMusicChannel, gVoiceChannel, gSoundFXChannel
- if objectp(gTextFileID) then
- gTextFileID(mdispose)
- end if
- unloadMember()
- set the actorList to []
- repeat with i = 1 to 48
- if the puppet of sprite i then
- puppetSprite(i, 0)
- end if
- end repeat
- sound stop gMusicChannel
- sound stop gVoiceChannel
- sound stop gSoundFXChannel
- set the volume of sound gMusicChannel to 255
- set the volume of sound gVoiceChannel to 255
- set the volume of sound gSoundFXChannel to 255
- end
-
- on addZeroes x
- set y to string(x)
- set outString to y
- repeat with i = 3 - length(y) down to 1
- set outString to 0 & outString
- end repeat
- return outString
- end
-
- on LingoPause pTicks
- set jTime to the timer
- repeat while the timer < (jTime + pTicks)
- end repeat
- end
-
- on KillEmPuppets
- repeat with i = 1 to 48
- if the puppet of sprite i then
- puppetSprite(i, 0)
- end if
- end repeat
- end
-
- on displayScores
- global gNumPlayers, gName1Sprite, gName2Sprite, gName3Sprite, gScore1Sprite, gScore2Sprite, gScore3Sprite
- case gNumPlayers of
- 1:
- if not (the puppet of sprite gName1Sprite) then
- puppetSprite(gName1Sprite, 1)
- end if
- set the memberNum of sprite gName1Sprite to the number of member "name1"
- if not (the puppet of sprite gScore1Sprite) then
- puppetSprite(gScore1Sprite, 1)
- end if
- set the memberNum of sprite gScore1Sprite to the number of member "player1 score"
- 2:
- if not (the puppet of sprite gName1Sprite) then
- puppetSprite(gName1Sprite, 1)
- end if
- set the memberNum of sprite gName1Sprite to the number of member "name1"
- if not (the puppet of sprite gScore1Sprite) then
- puppetSprite(gScore1Sprite, 1)
- end if
- set the memberNum of sprite gScore1Sprite to the number of member "player1 score"
- if not (the puppet of sprite gName2Sprite) then
- puppetSprite(gName2Sprite, 1)
- end if
- set the memberNum of sprite gName2Sprite to the number of member "name2"
- if not (the puppet of sprite gScore2Sprite) then
- puppetSprite(gScore2Sprite, 1)
- end if
- set the memberNum of sprite gScore2Sprite to the number of member "player2 score"
- 3:
- if not (the puppet of sprite gName1Sprite) then
- puppetSprite(gName1Sprite, 1)
- end if
- set the memberNum of sprite gName1Sprite to the number of member "name1"
- if not (the puppet of sprite gScore1Sprite) then
- puppetSprite(gScore1Sprite, 1)
- end if
- set the memberNum of sprite gScore1Sprite to the number of member "player1 score"
- if not (the puppet of sprite gName2Sprite) then
- puppetSprite(gName2Sprite, 1)
- end if
- set the memberNum of sprite gName2Sprite to the number of member "name2"
- if not (the puppet of sprite gScore2Sprite) then
- puppetSprite(gScore2Sprite, 1)
- end if
- set the memberNum of sprite gScore2Sprite to the number of member "player2 score"
- if not (the puppet of sprite gName3Sprite) then
- puppetSprite(gName3Sprite, 1)
- end if
- set the memberNum of sprite gName3Sprite to the number of member "name3"
- if not (the puppet of sprite gScore3Sprite) then
- puppetSprite(gScore3Sprite, 1)
- end if
- set the memberNum of sprite gScore3Sprite to the number of member "player3 score"
- end case
- end
-
- on BuzzInHandler
- global gWhoBuzzedIn, gNumPlayers, gKeyList, gVoiceChannel, gPathToSound, fileDelimiter, gSoundFXChannel
- set jKey to the keyPressed
- if (jKey = "a") or ((jKey = "A") and (gWhoBuzzedIn <> 1)) then
- sound playFile gSoundFXChannel, gPathToSound & "soundfx" & fileDelimiter & "click.aif"
- sound playFile gVoiceChannel, gPathToSound & "qanda" & fileDelimiter & "player1.aif"
- set gWhoBuzzedIn to 1
- else
- if (jKey = "b") or ((jKey = "B") and (gNumPlayers > 1) and (gWhoBuzzedIn <> 2)) then
- sound playFile gSoundFXChannel, gPathToSound & "soundfx" & fileDelimiter & "click.aif"
- sound playFile gVoiceChannel, gPathToSound & "qanda" & fileDelimiter & "player2.aif"
- set gWhoBuzzedIn to 2
- else
- if (jKey = "l") or ((jKey = "L") and (gNumPlayers > 2) and (gWhoBuzzedIn <> 3)) then
- sound playFile gSoundFXChannel, gPathToSound & "soundfx" & fileDelimiter & "click.aif"
- sound playFile gVoiceChannel, gPathToSound & "qanda" & fileDelimiter & "player3.aif"
- set gWhoBuzzedIn to 3
- else
- exit
- end if
- end if
- end if
- sound playFile gSoundFXChannel, gPathToSound & "soundFX" & fileDelimiter & "ticking2.aif"
- go(marker(1))
- end
-
- on Capitalize pField
- set jChar to charToNum(char 1 of field pField)
- if (jChar < 123) and (jChar > 96) then
- case jChar of
- 97:
- put "A" into char 1 of field pField
- 98:
- put "B" into char 1 of field pField
- 99:
- put "C" into char 1 of field pField
- 100:
- put "D" into char 1 of field pField
- 101:
- put "E" into char 1 of field pField
- 102:
- put "F" into char 1 of field pField
- 103:
- put "G" into char 1 of field pField
- 104:
- put "H" into char 1 of field pField
- 105:
- put "I" into char 1 of field pField
- 106:
- put "J" into char 1 of field pField
- 107:
- put "K" into char 1 of field pField
- 108:
- put "L" into char 1 of field pField
- 109:
- put "M" into char 1 of field pField
- 110:
- put "N" into char 1 of field pField
- 111:
- put "O" into char 1 of field pField
- 112:
- put "P" into char 1 of field pField
- 113:
- put "Q" into char 1 of field pField
- 114:
- put "R" into char 1 of field pField
- 115:
- put "S" into char 1 of field pField
- 116:
- put "T" into char 1 of field pField
- 117:
- put "U" into char 1 of field pField
- 118:
- put "V" into char 1 of field pField
- 119:
- put "W" into char 1 of field pField
- 120:
- put "X" into char 1 of field pField
- 121:
- put "Y" into char 1 of field pField
- 122:
- put "Z" into char 1 of field pField
- end case
- end if
- end
-